package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.llcx.ITelSpaceContract;
import com.feihong.txgw.model.bean.llcx.PhoneCardLocation;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName TelSpaceMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/7 17:21
 * @Describe
 * @Change
 */
public class TelSpaceMainModel implements ITelSpaceContract.ITelSpaceMainModel {

    public static TelSpaceMainModel create(){
        return new TelSpaceMainModel();
    }

    @Override
    public Observable<PhoneCardLocation> vertifyTel(String telNum) {
        return RetrofitManager.getInstance().vertifyTelType(telNum).compose(RxHelper.<PhoneCardLocation>rxSchedulerHelper());
    }

    @Override
    public Observable<String> getTelSpace(String icpID, String telNum, String code) {
        return RetrofitManager.getInstance().getTelSpaceInfo(icpID, telNum, code).compose(RxHelper.<String>rxSchedulerHelper());
    }

    @Override
    public Observable<String> sendVerityCode(String icpID, String telNum) {
        return RetrofitManager.getInstance().sendVertiryCode(icpID, telNum).compose(RxHelper.<String>rxSchedulerHelper());
    }
}
